import pandas as pd

# 读取CSV文件
file_path = r'D:\python1\doc\boss直聘数据.csv'

try:
    # 尝试读取CSV文件
    df = pd.read_csv(file_path, encoding='utf-8')
    print("文件读取成功")
    print(f"数据形状: {df.shape}")
    
    # 显示一些关键列的示例数据
    print("\n职位标题示例:")
    print(df['title'].head(10))
    
    print("\n薪资范围示例:")
    print(df['salary'].head(10))
    
    print("\n工作经验要求示例:")
    print(df['workExperience'].head(10))
    
    print("\n学历要求示例:")
    print(df['educational'].head(10))
    
    print("\n公司名称示例:")
    print(df['companyTitle'].head(10))
    
    print("\n工作地点示例:")
    print(df['address'].head(10))
    
    # 显示唯一值统计
    print(f"\n不同职位类型数量: {df['type'].nunique()}")
    print(f"不同公司数量: {df['companyTitle'].nunique()}")
    print(f"不同工作地点数量: {df['address'].nunique()}")
    
except Exception as e:
    print(f"读取文件时出错: {e}")